package br.ufrj.neg.reuniao.servlet;

import java.io.IOException;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.velocity.tools.view.VelocityViewServlet;

import br.ufrj.neg.constants.General;



public class NovaReuniaoAction extends VelocityViewServlet {

	private static final long serialVersionUID = -4622334544125714569L;
	//private static Logger log = Logger.getLogger("rootLogger");
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		try {
			/*
			 * Pega a sessao
			 */
			HttpSession session = request.getSession(false);
			synchronized(session){
				session.removeAttribute("NegociacaoBean");
			}
			request.getRequestDispatcher(General.TEMPLATE_REUNIAO_PATH + "cadastraReuniao.vm").forward(request,response);
			
		} catch (Exception e) {
			System.out.println(e);
			request.getRequestDispatcher(General.TELA_ERRO_500).forward(request,
					response);
		}
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
	throws IOException, ServletException {
		doPost(request,response);
	}

}
